package com.atguigu.atcrowdfunding.service.impl;

import com.atguigu.atcrowdfunding.bean.Role;
import com.atguigu.atcrowdfunding.dao.RoleDao;
import com.atguigu.atcrowdfunding.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * lcd  2020/3/31
 * Description:
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDao roleDao;
    @Override
    public List<Role> queryPage(Map<String, Object> map) {
        return roleDao.queryPage(map);
    }

    @Override
    public Integer queryCount(Map<String, Object> map) {
        return roleDao.queryCount(map);
    }

    @Override
    public void insert(Role role) {
        roleDao.insert(role);
    }

    @Override
    public Role findById(String id) {
        return roleDao.findById(id);
    }

    @Override
    public void update(Role role) {
        roleDao.update(role);
    }

    @Override
    public void delete(String id) {
        roleDao.delete(id);
    }

    @Override
    public void deletes(Map<String, Object> map) {
        roleDao.deletes(map);
    }

    @Override
    public List<Role> findAll() {
        return roleDao.findAll();
    }

    @Override
    public void doAssign(Map<String, Object> map) {
        roleDao.deleteBeforeRelation(map);
        roleDao.doAssign(map);
    }
}
